package day01;

/**
 * @Author Stringzhua
 * @Date 2024/10/28 15:04
 * description:
 * 创建线程的方式:创建Thread对象
 * 实现线程的方式:继承Thread类，实现Runnable接口，实现Callable接口，线程池
 */
public class Test03 {
    public static void main(String[] args) {
        TheadImpl t1 = new TheadImpl();
        t1.start();

        RunableImpl runable = new RunableImpl();
        Thread t2 = new Thread(runable);
        t2.start();


    }
}

class TheadImpl extends Thread {
    @Override
    public void run() {
        for (char i = 'a'; i < 'z'; i++) {
            System.out.println(Thread.currentThread().getName() + ":" + i);
        }
    }
}

class RunableImpl implements Runnable {
    @Override
    public void run() {
        for (char i = 'A'; i < 'Z'; i++) {
            System.out.println(Thread.currentThread().getName() + ":" + i);
        }
    }
}
